package com.atguigu.lease.common.utils;

import java.util.Random;

/**
 * @author Marco
 * @date 2025/8/7 14:16
 * @email 3293336923@qq.com
 * @Description   生成验证码
 */
public class CodeUtil {

    public   static    String     getRandomCode(Integer   length){

        StringBuilder stringBuilder = new StringBuilder();
        Random random = new Random();
        for (int i = 0; i < length; i++) {
            int num = random.nextInt(10);
            stringBuilder.append(num);
        }
        return  stringBuilder.toString();
    }
}
